package com.itluma.isWOak.pojo;

import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class AdminInfo {
    private Integer adminId;
    private String adminCode;
    private String password;
    private String name;
    private String telPhone;
    private String email;
    private Date enrollDate;
    private List<RoleInfo> roleInfos;
    public String getAllRoleInfoNames(){
        String allRoleInfoNames = "";
        if(roleInfos == null || roleInfos.size() == 0){
            allRoleInfoNames = "该账号没有任何角色！";
            return allRoleInfoNames;
        }
        for (int i = 0; i < roleInfos.size(); i++) {
            if(i != roleInfos.size() - 1){
                allRoleInfoNames = allRoleInfoNames.concat(roleInfos.get(i).getName() + ",");
            }else {
                allRoleInfoNames = allRoleInfoNames.concat(roleInfos.get(i).getName());
            }

        }
        return allRoleInfoNames;
    }
}
